﻿
namespace Company.Shell.Models
{
    /// <summary>
    /// 寄存器某一个位报警的提示内容，由用户自定义
    /// </summary>
    public class AlarmItem
    {
        /// <summary>
        /// 位地址：27.00 - 27.15
        /// </summary>
        public string? Address { get; set; } 
        /// <summary>
        /// 报警描述
        /// </summary>
        public string? Description { get; set; }
        /// <summary>
        /// 获取位地址 
        /// </summary>
        /// <param name="address"></param>
        /// <param name="i"></param>
        /// <returns></returns>
        public static string GetAddress(int address, int i)
        {
            return $"{address}."+i.ToString().PadLeft(2,'0');// 27.00 - 27.15
        }
    }
}
